YES 1.307 H-Termination proof of /home/matraf/haskell/eval_FullyBlown_Fast/List.hs
H-Termination of the given Haskell-Program with start terms could successfully be proven:



HASKELL
  ↳ LR

mainModule List
  ((genericSplitAt :: Int  ->  [a ->  ([a],[a])) :: Int  ->  [a ->  ([a],[a]))

module List where
  import qualified Maybe
import qualified Prelude

  genericSplitAt :: Integral b => b  ->  [a ->  ([a],[a])
genericSplitAt xs ([],xs)
genericSplitAt [] ([],[])
genericSplitAt n (x : xs
 | n > 0 = 
(x : xs',xs'') where 
vv9 genericSplitAt (n - 1) xs
xs' (\(xs',_) ->xs') vv9
xs'' (\(_,xs'') ->xs'') vv9
genericSplitAt _ _ error []


module Maybe where
  import qualified List
import qualified Prelude



Lambda Reductions:
The following Lambda expression
\(xs',_)→xs'

is transformed to
xs'0 (xs',_) = xs'

The following Lambda expression
\(_,xs'')→xs''

is transformed to
xs''0 (_,xs'') = xs''



↳ HASKELL
  ↳ LR
HASKELL
      ↳ CR

mainModule List
  ((genericSplitAt :: Int  ->  [a ->  ([a],[a])) :: Int  ->  [a ->  ([a],[a]))

module List where
  import qualified Maybe
import qualified Prelude

  genericSplitAt :: Integral b => b  ->  [a ->  ([a],[a])
genericSplitAt xs ([],xs)
genericSplitAt [] ([],[])
genericSplitAt n (x : xs
 | n > 0 = 
(x : xs',xs'') where 
vv9 genericSplitAt (n - 1) xs
xs' xs'0 vv9
xs'' xs''0 vv9
xs''0 (_,xs''xs''
xs'0 (xs',_) xs'
genericSplitAt _ _ error []


module Maybe where
  import qualified List
import qualified Prelude



Case Reductions:
The following Case expression
case compare x y of
 EQ → o
 LT → LT
 GT → GT

is transformed to
primCompAux0 o EQ = o
primCompAux0 o LT = LT
primCompAux0 o GT = GT



↳ HASKELL
  ↳ LR
    ↳ HASKELL
      ↳ CR
HASKELL
          ↳ IFR

mainModule List
  ((genericSplitAt :: Int  ->  [a ->  ([a],[a])) :: Int  ->  [a ->  ([a],[a]))

module List where
  import qualified Maybe
import qualified Prelude

  genericSplitAt :: Integral b => b  ->  [a ->  ([a],[a])
genericSplitAt xs ([],xs)
genericSplitAt [] ([],[])
genericSplitAt n (x : xs
 | n > 0 = 
(x : xs',xs'') where 
vv9 genericSplitAt (n - 1) xs
xs' xs'0 vv9
xs'' xs''0 vv9
xs''0 (_,xs''xs''
xs'0 (xs',_) xs'
genericSplitAt _ _ error []


module Maybe where
  import qualified List
import qualified Prelude



If Reductions:
The following If expression
if primGEqNatS x y then Succ (primDivNatS (primMinusNatS x y) (Succ y)) else Zero

is transformed to
primDivNatS0 x y True = Succ (primDivNatS (primMinusNatS x y) (Succ y))
primDivNatS0 x y False = Zero

The following If expression
if primGEqNatS x y then primModNatS (primMinusNatS x y) (Succ y) else Succ x

is transformed to
primModNatS0 x y True = primModNatS (primMinusNatS x y) (Succ y)
primModNatS0 x y False = Succ x



↳ HASKELL
  ↳ LR
    ↳ HASKELL
      ↳ CR
        ↳ HASKELL
          ↳ IFR
HASKELL
              ↳ BR

mainModule List
  ((genericSplitAt :: Int  ->  [a ->  ([a],[a])) :: Int  ->  [a ->  ([a],[a]))

module List where
  import qualified Maybe
import qualified Prelude

  genericSplitAt :: Integral b => b  ->  [a ->  ([a],[a])
genericSplitAt xs ([],xs)
genericSplitAt [] ([],[])
genericSplitAt n (x : xs
 | n > 0 = 
(x : xs',xs'') where 
vv9 genericSplitAt (n - 1) xs
xs' xs'0 vv9
xs'' xs''0 vv9
xs''0 (_,xs''xs''
xs'0 (xs',_) xs'
genericSplitAt _ _ error []


module Maybe where
  import qualified List
import qualified Prelude



Replaced joker patterns by fresh variables and removed binding patterns.

↳ HASKELL
  ↳ LR
    ↳ HASKELL
      ↳ CR
        ↳ HASKELL
          ↳ IFR
            ↳ HASKELL
              ↳ BR
HASKELL
                  ↳ COR

mainModule List
  ((genericSplitAt :: Int  ->  [a ->  ([a],[a])) :: Int  ->  [a ->  ([a],[a]))

module List where
  import qualified Maybe
import qualified Prelude

  genericSplitAt :: Integral b => b  ->  [a ->  ([a],[a])
genericSplitAt xs ([],xs)
genericSplitAt vw [] ([],[])
genericSplitAt n (x : xs
 | n > 0 = 
(x : xs',xs'') where 
vv9 genericSplitAt (n - 1) xs
xs' xs'0 vv9
xs'' xs''0 vv9
xs''0 (vx,xs''xs''
xs'0 (xs',vyxs'
genericSplitAt vz wu error []


module Maybe where
  import qualified List
import qualified Prelude



Cond Reductions:
The following Function with conditions
genericSplitAt xs = ([],xs)
genericSplitAt vw [] = ([],[])
genericSplitAt n (x : xs)
 | n > 0
 = (x : xs',xs'')
where 
vv9  = genericSplitAt (n - 1) xs
xs'  = xs'0 vv9
xs''  = xs''0 vv9
xs''0 (vx,xs'') = xs''
xs'0 (xs',vy) = xs'
genericSplitAt vz wu = error []

is transformed to
genericSplitAt vvx xs = genericSplitAt5 vvx xs
genericSplitAt vw [] = genericSplitAt3 vw []
genericSplitAt n (x : xs) = genericSplitAt2 n (x : xs)
genericSplitAt vz wu = genericSplitAt0 vz wu

genericSplitAt0 vz wu = error []

genericSplitAt2 n (x : xs) = 
genericSplitAt1 n x xs (n > 0)
where 
genericSplitAt1 n x xs True = (x : xs',xs'')
genericSplitAt1 n x xs False = genericSplitAt0 n (x : xs)
vv9  = genericSplitAt (n - 1) xs
xs'  = xs'0 vv9
xs''  = xs''0 vv9
xs''0 (vx,xs'') = xs''
xs'0 (xs',vy) = xs'
genericSplitAt2 vuy vuz = genericSplitAt0 vuy vuz

genericSplitAt3 vw [] = ([],[])
genericSplitAt3 vvv vvw = genericSplitAt2 vvv vvw

genericSplitAt4 True vvx xs = ([],xs)
genericSplitAt4 vvy vvz vwu = genericSplitAt3 vvz vwu

genericSplitAt5 vvx xs = genericSplitAt4 (vvx == 0) vvx xs
genericSplitAt5 vwv vww = genericSplitAt3 vwv vww

The following Function with conditions
compare x y
 | x == y
 = EQ
 | x <= y
 = LT
 | otherwise
 = GT

is transformed to
compare x y = compare3 x y

compare0 x y True = GT

compare2 x y True = EQ
compare2 x y False = compare1 x y (x <= y)

compare1 x y True = LT
compare1 x y False = compare0 x y otherwise

compare3 x y = compare2 x y (x == y)

The following Function with conditions
gcd' x 0 = x
gcd' x y = gcd' y (x `rem` y)

is transformed to
gcd' x vwx = gcd'2 x vwx
gcd' x y = gcd'0 x y

gcd'0 x y = gcd' y (x `rem` y)

gcd'1 True x vwx = x
gcd'1 vwy vwz vxu = gcd'0 vwz vxu

gcd'2 x vwx = gcd'1 (vwx == 0) x vwx
gcd'2 vxv vxw = gcd'0 vxv vxw

The following Function with conditions
gcd 0 0 = error []
gcd x y = 
gcd' (abs x) (abs y)
where 
gcd' x 0 = x
gcd' x y = gcd' y (x `rem` y)

is transformed to
gcd vxx vxy = gcd3 vxx vxy
gcd x y = gcd0 x y

gcd0 x y = 
gcd' (abs x) (abs y)
where 
gcd' x vwx = gcd'2 x vwx
gcd' x y = gcd'0 x y
gcd'0 x y = gcd' y (x `rem` y)
gcd'1 True x vwx = x
gcd'1 vwy vwz vxu = gcd'0 vwz vxu
gcd'2 x vwx = gcd'1 (vwx == 0) x vwx
gcd'2 vxv vxw = gcd'0 vxv vxw

gcd1 True vxx vxy = error []
gcd1 vxz vyu vyv = gcd0 vyu vyv

gcd2 True vxx vxy = gcd1 (vxy == 0) vxx vxy
gcd2 vyw vyx vyy = gcd0 vyx vyy

gcd3 vxx vxy = gcd2 (vxx == 0) vxx vxy
gcd3 vyz vzu = gcd0 vyz vzu

The following Function with conditions
reduce x y
 | y == 0
 = error []
 | otherwise
 = x `quot` d :% (y `quot` d)
where 
d  = gcd x y

is transformed to
reduce x y = reduce2 x y

reduce2 x y = 
reduce1 x y (y == 0)
where 
d  = gcd x y
reduce0 x y True = x `quot` d :% (y `quot` d)
reduce1 x y True = error []
reduce1 x y False = reduce0 x y otherwise

The following Function with conditions
absReal x
 | x >= 0
 = x
 | otherwise
 = `negate` x

is transformed to
absReal x = absReal2 x

absReal1 x True = x
absReal1 x False = absReal0 x otherwise

absReal0 x True = `negate` x

absReal2 x = absReal1 x (x >= 0)

The following Function with conditions
undefined 
 | False
 = undefined

is transformed to
undefined  = undefined1

undefined0 True = undefined

undefined1  = undefined0 False



↳ HASKELL
  ↳ LR
    ↳ HASKELL
      ↳ CR
        ↳ HASKELL
          ↳ IFR
            ↳ HASKELL
              ↳ BR
                ↳ HASKELL
                  ↳ COR
HASKELL
                      ↳ LetRed

mainModule List
  ((genericSplitAt :: Int  ->  [a ->  ([a],[a])) :: Int  ->  [a ->  ([a],[a]))

module List where
  import qualified Maybe
import qualified Prelude

  genericSplitAt :: Integral a => a  ->  [b ->  ([b],[b])
genericSplitAt vvx xs genericSplitAt5 vvx xs
genericSplitAt vw [] genericSplitAt3 vw []
genericSplitAt n (x : xsgenericSplitAt2 n (x : xs)
genericSplitAt vz wu genericSplitAt0 vz wu

  
genericSplitAt0 vz wu error []

  
genericSplitAt2 n (x : xs
genericSplitAt1 n x xs (n > 0) where 
genericSplitAt1 n x xs True (x : xs',xs'')
genericSplitAt1 n x xs False genericSplitAt0 n (x : xs)
vv9 genericSplitAt (n - 1) xs
xs' xs'0 vv9
xs'' xs''0 vv9
xs''0 (vx,xs''xs''
xs'0 (xs',vyxs'
genericSplitAt2 vuy vuz genericSplitAt0 vuy vuz

  
genericSplitAt3 vw [] ([],[])
genericSplitAt3 vvv vvw genericSplitAt2 vvv vvw

  
genericSplitAt4 True vvx xs ([],xs)
genericSplitAt4 vvy vvz vwu genericSplitAt3 vvz vwu

  
genericSplitAt5 vvx xs genericSplitAt4 (vvx == 0) vvx xs
genericSplitAt5 vwv vww genericSplitAt3 vwv vww


module Maybe where
  import qualified List
import qualified Prelude



Let/Where Reductions:
The bindings of the following Let/Where expression
genericSplitAt1 n x xs (n > 0)
where 
genericSplitAt1 n x xs True = (x : xs',xs'')
genericSplitAt1 n x xs False = genericSplitAt0 n (x : xs)
vv9  = genericSplitAt (n - 1) xs
xs'  = xs'0 vv9
xs''  = xs''0 vv9
xs''0 (vx,xs'') = xs''
xs'0 (xs',vy) = xs'

are unpacked to the following functions on top level
genericSplitAt2Xs'0 vzv vzw (xs',vy) = xs'

genericSplitAt2GenericSplitAt1 vzv vzw n x xs True = (x : genericSplitAt2Xs' vzv vzw,genericSplitAt2Xs'' vzv vzw)
genericSplitAt2GenericSplitAt1 vzv vzw n x xs False = genericSplitAt0 n (x : xs)

genericSplitAt2Xs'' vzv vzw = genericSplitAt2Xs''0 vzv vzw (genericSplitAt2Vv9 vzv vzw)

genericSplitAt2Vv9 vzv vzw = genericSplitAt (vzv - 1) vzw

genericSplitAt2Xs' vzv vzw = genericSplitAt2Xs'0 vzv vzw (genericSplitAt2Vv9 vzv vzw)

genericSplitAt2Xs''0 vzv vzw (vx,xs'') = xs''

The bindings of the following Let/Where expression
reduce1 x y (y == 0)
where 
d  = gcd x y
reduce0 x y True = x `quot` d :% (y `quot` d)
reduce1 x y True = error []
reduce1 x y False = reduce0 x y otherwise

are unpacked to the following functions on top level
reduce2Reduce0 vzx vzy x y True = x `quot` reduce2D vzx vzy :% (y `quot` reduce2D vzx vzy)

reduce2Reduce1 vzx vzy x y True = error []
reduce2Reduce1 vzx vzy x y False = reduce2Reduce0 vzx vzy x y otherwise

reduce2D vzx vzy = gcd vzx vzy

The bindings of the following Let/Where expression
gcd' (abs x) (abs y)
where 
gcd' x vwx = gcd'2 x vwx
gcd' x y = gcd'0 x y
gcd'0 x y = gcd' y (x `rem` y)
gcd'1 True x vwx = x
gcd'1 vwy vwz vxu = gcd'0 vwz vxu
gcd'2 x vwx = gcd'1 (vwx == 0) x vwx
gcd'2 vxv vxw = gcd'0 vxv vxw

are unpacked to the following functions on top level
gcd0Gcd' x vwx = gcd0Gcd'2 x vwx
gcd0Gcd' x y = gcd0Gcd'0 x y

gcd0Gcd'2 x vwx = gcd0Gcd'1 (vwx == 0) x vwx
gcd0Gcd'2 vxv vxw = gcd0Gcd'0 vxv vxw

gcd0Gcd'0 x y = gcd0Gcd' y (x `rem` y)

gcd0Gcd'1 True x vwx = x
gcd0Gcd'1 vwy vwz vxu = gcd0Gcd'0 vwz vxu



↳ HASKELL
  ↳ LR
    ↳ HASKELL
      ↳ CR
        ↳ HASKELL
          ↳ IFR
            ↳ HASKELL
              ↳ BR
                ↳ HASKELL
                  ↳ COR
                    ↳ HASKELL
                      ↳ LetRed
HASKELL
                          ↳ NumRed

mainModule List
  ((genericSplitAt :: Int  ->  [a ->  ([a],[a])) :: Int  ->  [a ->  ([a],[a]))

module List where
  import qualified Maybe
import qualified Prelude

  genericSplitAt :: Integral a => a  ->  [b ->  ([b],[b])
genericSplitAt vvx xs genericSplitAt5 vvx xs
genericSplitAt vw [] genericSplitAt3 vw []
genericSplitAt n (x : xsgenericSplitAt2 n (x : xs)
genericSplitAt vz wu genericSplitAt0 vz wu

  
genericSplitAt0 vz wu error []

  
genericSplitAt2 n (x : xsgenericSplitAt2GenericSplitAt1 n xs n x xs (n > 0)
genericSplitAt2 vuy vuz genericSplitAt0 vuy vuz

  
genericSplitAt2GenericSplitAt1 vzv vzw n x xs True (x : genericSplitAt2Xs' vzv vzw,genericSplitAt2Xs'' vzv vzw)
genericSplitAt2GenericSplitAt1 vzv vzw n x xs False genericSplitAt0 n (x : xs)

  
genericSplitAt2Vv9 vzv vzw genericSplitAt (vzv - 1) vzw

  
genericSplitAt2Xs' vzv vzw genericSplitAt2Xs'0 vzv vzw (genericSplitAt2Vv9 vzv vzw)

  
genericSplitAt2Xs'' vzv vzw genericSplitAt2Xs''0 vzv vzw (genericSplitAt2Vv9 vzv vzw)

  
genericSplitAt2Xs''0 vzv vzw (vx,xs''xs''

  
genericSplitAt2Xs'0 vzv vzw (xs',vyxs'

  
genericSplitAt3 vw [] ([],[])
genericSplitAt3 vvv vvw genericSplitAt2 vvv vvw

  
genericSplitAt4 True vvx xs ([],xs)
genericSplitAt4 vvy vvz vwu genericSplitAt3 vvz vwu

  
genericSplitAt5 vvx xs genericSplitAt4 (vvx == 0) vvx xs
genericSplitAt5 vwv vww genericSplitAt3 vwv vww


module Maybe where
  import qualified List
import qualified Prelude



Num Reduction: All numbers are transformed to thier corresponding representation with Pos, Neg, Succ and Zero.

↳ HASKELL
  ↳ LR
    ↳ HASKELL
      ↳ CR
        ↳ HASKELL
          ↳ IFR
            ↳ HASKELL
              ↳ BR
                ↳ HASKELL
                  ↳ COR
                    ↳ HASKELL
                      ↳ LetRed
                        ↳ HASKELL
                          ↳ NumRed
HASKELL
                              ↳ Narrow

mainModule List
  (genericSplitAt :: Int  ->  [a ->  ([a],[a]))

module List where
  import qualified Maybe
import qualified Prelude

  genericSplitAt :: Integral a => a  ->  [b ->  ([b],[b])
genericSplitAt vvx xs genericSplitAt5 vvx xs
genericSplitAt vw [] genericSplitAt3 vw []
genericSplitAt n (x : xsgenericSplitAt2 n (x : xs)
genericSplitAt vz wu genericSplitAt0 vz wu

  
genericSplitAt0 vz wu error []

  
genericSplitAt2 n (x : xsgenericSplitAt2GenericSplitAt1 n xs n x xs (n > fromInt (Pos Zero))
genericSplitAt2 vuy vuz genericSplitAt0 vuy vuz

  
genericSplitAt2GenericSplitAt1 vzv vzw n x xs True (x : genericSplitAt2Xs' vzv vzw,genericSplitAt2Xs'' vzv vzw)
genericSplitAt2GenericSplitAt1 vzv vzw n x xs False genericSplitAt0 n (x : xs)

  
genericSplitAt2Vv9 vzv vzw genericSplitAt (vzv - fromInt (Pos (Succ Zero))) vzw

  
genericSplitAt2Xs' vzv vzw genericSplitAt2Xs'0 vzv vzw (genericSplitAt2Vv9 vzv vzw)

  
genericSplitAt2Xs'' vzv vzw genericSplitAt2Xs''0 vzv vzw (genericSplitAt2Vv9 vzv vzw)

  
genericSplitAt2Xs''0 vzv vzw (vx,xs''xs''

  
genericSplitAt2Xs'0 vzv vzw (xs',vyxs'

  
genericSplitAt3 vw [] ([],[])
genericSplitAt3 vvv vvw genericSplitAt2 vvv vvw

  
genericSplitAt4 True vvx xs ([],xs)
genericSplitAt4 vvy vvz vwu genericSplitAt3 vvz vwu

  
genericSplitAt5 vvx xs genericSplitAt4 (vvx == fromInt (Pos Zero)) vvx xs
genericSplitAt5 vwv vww genericSplitAt3 vwv vww


module Maybe where
  import qualified List
import qualified Prelude



Haskell To QDPs


↳ HASKELL
  ↳ LR
    ↳ HASKELL
      ↳ CR
        ↳ HASKELL
          ↳ IFR
            ↳ HASKELL
              ↳ BR
                ↳ HASKELL
                  ↳ COR
                    ↳ HASKELL
                      ↳ LetRed
                        ↳ HASKELL
                          ↳ NumRed
                            ↳ HASKELL
                              ↳ Narrow
QDP
                                  ↳ QDPSizeChangeProof

Q DP problem:
The TRS P consists of the following rules:

new_genericSplitAt2Vv9(vzz300, vzz41, ba) → new_genericSplitAt(new_primMinusNat(vzz300), vzz41, ba)
new_genericSplitAt(Pos(Succ(vzz300)), :(vzz40, vzz41), ba) → new_genericSplitAt2Vv9(vzz300, vzz41, ba)
new_genericSplitAt(Pos(Succ(vzz300)), :(vzz40, vzz41), ba) → new_genericSplitAt(new_primMinusNat(vzz300), vzz41, ba)

The TRS R consists of the following rules:

new_primMinusNat(Succ(vzz3000)) → Pos(Succ(vzz3000))
new_primMinusNat(Zero) → Pos(Zero)

The set Q consists of the following terms:

new_primMinusNat(Zero)
new_primMinusNat(Succ(x0))

We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs: